Java: add test exercising Gradle download pruning#19135
Merged
smowton merged 2 commits intogithub:mainfrom Mar 31, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new integration test and corresponding change note to ensure that, under buildless mode with Gradle, the system no longer attempts to download non-jar Maven artifacts (e.g. BOMs).
- Updates the change notes to document the fix.
- Adds a Python integration test to exercise Gradle download pruning.
- Introduces a Java test file that, however, appears to misuse the @test annotation.
Reviewed Changes
Copilot reviewed 3 out of 8 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| java/ql/lib/change-notes/2025-03-27-gradle-fetch-reduction.md | Updated changenotes explaining the download pruning fix. |
| java/ql/integration-tests/java/buildless-gradle-boms/test.py | Added a new integration test for Gradle BOM download pruning. |
| java/ql/integration-tests/java/buildless-gradle-boms/src/main/java/com/fractestexample/Test.java | Contains a method that improperly uses the JUnit @test annotation as a parameter. |
Files not reviewed (5)
- java/ql/integration-tests/java/buildless-gradle-boms/build.gradle: Language not supported
- java/ql/integration-tests/java/buildless-gradle-boms/buildless-fetches.expected: Language not supported
- java/ql/integration-tests/java/buildless-gradle-boms/diagnostics.expected: Language not supported
- java/ql/integration-tests/java/buildless-gradle-boms/settings.gradle: Language not supported
- java/ql/integration-tests/java/buildless-gradle-boms/source_archive.expected: Language not supported
Comments suppressed due to low confidence (1)
java/ql/integration-tests/java/buildless-gradle-boms/test.py:1
- The integration test currently creates a database but does not verify that the BOM artifact is pruned. Consider adding assertions or checks to confirm that no unwanted downloads occur.
def test(codeql, java, gradle_8_3):
Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more
Comment on lines
+7
to
+8
| public Fraction test(org.junit.jupiter.api.Test t) { return Fraction.ONE; } | ||
|
|
There was a problem hiding this comment.
Using org.junit.jupiter.api.Test as a parameter type appears to be incorrect; consider annotating the method with @test and removing the parameter to correctly define a test method.
Suggested change
| public Fraction test(org.junit.jupiter.api.Test t) { return Fraction.ONE; } | |
| @Test | |
| public Fraction test() { return Fraction.ONE; } |
aibaars
approved these changes
Mar 31, 2025
dc4a280 to
766b735
Compare
766b735 to
d8f7f18
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This exhibits that buildless doesn't attempt to download junit-bom, a non-jar dependency of junit-jupiter-api.